package com.cmcc.waf.report.feign;


import com.cmcc.waf.report.feign.model.*;
import com.cmcc.waf.report.request.ThreatTypeRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

@FeignClient(name = "waf-openapi", url = "https://ecloud.10086.cn", configuration = FeignConfig.class)
public interface OpenAPIFeign {

    /**
     * 攻击总次数
     * @param request
     * @return
     */
    @PostMapping(value = "/api/openapi-wafc/monitor/security/alarmTrend")
    ResponseVO<List<WebSafeInfoVO.AlarmTrend>> getTotal(@RequestBody WebSafeRequest request);

    /**
     * 攻击趋势
     * @param request
     * @return
     */
    @PostMapping(value = "/api/openapi-wafc/monitor/security/alarmTrend")
    ResponseVO<List<WebSafeInfoVO.AlarmTrend>> getCount(@RequestBody WebSafeRequest request);

    @GetMapping(value = "/api/openapi-wafc/dashboard/count")
    ResponseVO<Object> getCount();

    @PostMapping(value = "/api/openapi-wafc/monitor/security/threatType")
    ResponseVO<List<ThreatTypeVO>> getThreatTypes(@RequestBody ThreatTypeRequest request);

    /**
     * 威胁主机TOP5
     * @return
     */
    @PostMapping(value = "/api/openapi-wafc/webSafe/threatHostTop")
    ResponseVO<List<QmThreatHostTopResponse>> threatHostTop(@RequestBody @Valid WebSafeRequest request);


    /**
     * 告警事件TOP5
     * @param request
     * @return
     */
    @PostMapping("/api/openapi-wafc/monitor/security/realtimeEventTop")
    ResponseVO<List<EventVO>> realtimeEventTop(@RequestBody @Valid WebSafeRequest request);

    /**
     * 源iptop5
     * @param request
     * @return
     */
    @PostMapping(value = "/api/openapi-wafc/monitor/security/srcIpTop")
    ResponseVO<List<SrcIpTopVO>> getSrcIpTop5(@RequestBody @Valid WebSafeRequest request);

    /**
     * 攻击来源地区TOP5
     * @param request
     * @return
     */
    @PostMapping(value = "/api/openapi-wafc/webSafe/attackRegions")
    ResponseVO<List<AttackRegionTopVO>> attackRegionTop5(@RequestBody @Valid WebSafeRequest request);
}
